package com.github.xuemingyu.springboot.jkfaststart.common;


import java.text.SimpleDateFormat;

/**
 * Created by yf003 on 2017/8/1.
 * 订单流水号工具类
 */
public class NoTool {


    public static String createNoFormat(String no,NoType noType){
        //当前时间
        Long da = System.currentTimeMillis();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm");
        String str = sdf.format(da);

        //单号

        String prefix = getPrefix(noType);
        String exssNo = prefix+str+no;

        return exssNo;
    }


    public static String getPrefix(NoType noType){
        switch (noType){
            case orderNumber:
                return "ONO";
                default:
                    return "";
        }
    }


}
